const express = require('express')
const router = express.Router()
const { submitAdminInfo, getAdminInfo, changeAdminPwd, uploadAdminAvatar } = require('../../controller/apis/adminController')

// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middlewares/checkTokenMiddleware')

// 提交管理员信息
router.patch('/admin', checkTokenMiddleware, submitAdminInfo)

// 获取管理员信息
router.get('/admin/:id', checkTokenMiddleware, getAdminInfo)

// 修改管理员密码
router.patch('/admin/pwd/:id', checkTokenMiddleware, changeAdminPwd)

// 上传管理员头像
router.post('/admin/avatar/upload', checkTokenMiddleware, uploadAdminAvatar)

module.exports = router